




// let onIndex = 'http://www.xiongmaoyouxuan.com/api/tab/1'
let onJiujiu = 'http://www.xiongmaoyouxuan.com/api/sub_column/7/items?start=0'//2
let dequan = 'http://www.xiongmaoyouxuan.com/api/sub_column/174/items?start=0'//3
let xiajinz = 'http://www.xiongmaoyouxuan.com/api/column/3183/items?start=0'//4
// ==================数据渲染====================



 const xxk = (url) => {
    jQuery.ajax({
    //   url: 'http://www.xiongmaoyouxuan.com/api/tab/1',
      url:url,
      type: 'get',
      data: {
        start:0
      },
      success(result){
          let response= result
        if(response.code == 200){
      let storeData = response.data.list
    //   console.log(storeData);
      showlist(storeData)
        // localStorage.setItem('LISTS',JSON.stringify(storeData))   
        }
      }
    })
 }

 
function zx(){
let huoqv = localStorage.getItem('dizhi')
xxk(huoqv)
}
zx()//2





















 //渲染列表
 const showlist = list => {
    data = {
      list
    }
    // console.log(list);
    let str = template('list', data)
    //   let asd =  $('.base-commodity-list').html(str)
   let asd= document.querySelector('.base-commodity-list')

    asd.innerHTML = str
}

// =======================渲染数据结束===========================


// ===============回到顶部==================
 /**
         * 回到顶部
         */
  function onBackTop() {
    var topDist = getScrollTop()
    var timer = setInterval(() => {
        topDist = topDist - 50
        setScrollTop(topDist)
        if (topDist <= 0) {
            clearInterval(timer)
        }
    }, 10);
}
/**
 * 兼容性写法
 * 设置页面向上滚动的距离
 */
function setScrollTop(dist) {
    if (document.body.scrollTop) {
        document.body.scrollTop = dist
    } else {
        document.documentElement.scrollTop = dist
    }
}
/**
 * 页面向上滚动的距离
 */
function getScrollTop() {
    if (document.body.scrollTop) {
        return document.body.scrollTop
    } else {
        return document.documentElement.scrollTop
    }
}
// ==============回到顶部结束===============


// ===================================


// ===============
